package com.pig4cloud.pig.demo.Mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pig4cloud.pig.demo.feign.Entity.Announcement;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AnnouncementMapper extends BaseMapper<Announcement> {

    @Select("SELECT a1.*  FROM announcement  AS a1  INNER JOIN announcement2 AS a2  ON a1.aid=a2.aid WHERE a2.isdel=1 AND a2.uid=#{id}")
    public List<Announcement> findA(String id);

    @Select("SELECT * FROM announcement ORDER BY publish_time DESC LIMIT 1")
    public Announcement findLastID();
}
